<html lang="java">
<head>
    <title>123</title>
    <style type="text/css">
        body
        {
            background-size: 100% 100%;
            height: 100%;
            width: 100%;
            text-align: center;
            margin-top: 50px;
            margin-left: auto;
        }
        table{
            text-align: center;
            margin: auto;
            text-decoration-color: #E3E6EB;
        }
        h1{
            font-size: 35px;
            color: #5d5a8b;
        }
    </style>
    <script type="text/javascript">
        window.onload = function () {
            //全选
            const allpIds = document.getElementById("allpIds");
            const pIds = document.getElementsByName("pIds");
            allpIds.onchange = function () {
           for (let i = 0; i <pIds.length ; i++) {
               pIds[i].checked  = allpIds.checked;
           }
       }
        };
        //定义一个方法清空，查询的条件
        function toreset() {
            var  selectname = document.getElementById("selectname");
            var  selectman = document.getElementById("selectman");
            selectname.value = "";
            selectman.value = "";
        }

        function  todelete() {
            if (  confirm("确定删除？")){
                //设置隐藏域的值
                document.getElementById("method").value="delete";
                //提交表单
                //  document.getElementById("myform").submit();
                document.forms[1].submit();
            }
        }
        function todaochu() {
            if (confirm("确定导出？")) {
                document.getElementById("method").value = "daochu";
                //提交表单
                document.forms[1].submit();
            }
        }
    </script>
</head>
<body background="/static/img/2.jpg" >
<h1>供应商管理</h1>
<form action="/record/selectproviderlist" method="post">
    <table cellpadding="4" cellspacing="1" >
        <tr>
            <td> 供应商名称：</td>
            <td><input type="text" value="${pName?if_exists}" name="pName" id="selectname"/></td>
            <td>联系人员：</td>
            <td><input type="text" value="${pLinkMan?if_exists}" name="pLinkMan" id="selectman"/></td>
            <td rowspan="2"><input type="submit" value="查询">&nbsp;<input type="button" value="清除" onclick="toreset()"></td>
        </tr>
    </table>
</form>
<#if  propage.list?size == 0>
<h1 style="text-align: center ;color: #1c94c4" >没有您查询的数据！<a  style="color: #1c94c4"  href="/record/selectproviderlist">返回</a> </h1>
<#else >
<div class="div_head" style="margin-left: 25% ; margin-top: auto">
            <span>
                    <span onclick="todaochu()" style="color: blue; cursor: pointer">【导出数据】</span>
                  <span>  <a style="text-decoration: none;" href="/record/insertprovider.html">【添加】</a></span>
                    <span onclick="todelete()" style="color: blue; cursor: pointer">【删除】</span>
            </span>
</div>
<br/>
<form action="/record/deleteanddaochuprovider" method="post">
    <input type="hidden" id="method" name="method">
    <table cellpadding="4" cellspacing="0" border="1" >
        <tr>
            <td width="30px;"><input type="checkbox"  id="allpIds"/></td>
            <td>序号</td>
            <td>供应商编码</td>
            <td>  供应商名称</td>
            <td>品牌</td>
            <td>联系人</td>
            <td>电话</td>
            <td>操作</td>
        </tr>
<#list  propage.list as provider>
    <tr>
        <td><input type="checkbox"  name="pIds" value="${provider.pId!''}"/></td>
        <td>${provider_index+1}</td>
        <td>${provider.pId!''}</td>
        <td> ${provider.pName!''}</td>
        <td>${provider.pBrand!''}</td>
        <td>${provider.pLinkMan!''}</td>
        <td>${provider.pLinkTel!''}</td>
        <td>
            <a href="/record/selectproviderone.html?pId=${provider.pId!''}">查看</a>
            <a href="/record/updateprovider.html?pId=${provider.pId!''}">编辑</a>
            <a href="/record/deletprovider.html?pId=${provider.pId!''}">删除</a>
        </td>
    </tr>
</#list>
        <tr >
            <td colspan="8" >
                <a href="/record/selectproviderlist?pName=${pName!''}&pLinkMan=${pLinkMan!''}">首页</a>
                                <a href="/record/selectproviderlist?index=${propage.prePage}&pName=${pName!''}&pLinkMan=${pLinkMan!''}" >上一页</a>
                                <a href="/record/selectproviderlist?index=${propage.nextPage}&pName=${pName!''}&pLinkMan=${pLinkMan!''}" >下一页</a>
                <a href="/record/selectproviderlist?index=${propage.pages}&pName=${pName!''}&pLinkMan=${pLinkMan!''}">尾页</a>
        共${propage.total}条  共${propage.pageNum}/${propage.pages}
            </td>
        </tr>
    </table>
</form>
</#if>
</body>
</html>